RANLIB= ranlib
CFLAGS=-Wall -W -g 

BINARY = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
TARGET = demo
OBJS = tsc.o
RED = \\e[1m\\e[31m
RESET = \\e[m
GREEN = \\e[1m\\e[32m

$(TARGET):$(OBJS) demo.cpp
	@echo -e "Make $(GREEN)$@$(RESET) begin......\c"
	$(CXX) -o $@ demo.cpp $(OBJS) $(CFLAGS) 

%.o:%.c
	@echo -e "Make $(GREEN)$@$(RESET) begin......\c"
	$(CXX)  $< -c $(CFLAGS) 
	@echo -e $(RED)"ok."$(RESET)

clean:
	rm -rf $(TARGET) ${BINARY} ${OBJS}
	@for xfile in $(OBJS); \
		do \
			(rm -rf $(BIN)/$$xfile); \
		done
	@echo "make clean done."

